<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title>Yooes管理中心</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="/sys-admin/css/general.css" rel="stylesheet" type="text/css">
<link href="/sys-admin/css/main.css" rel="stylesheet" type="text/css">
<script src="/sys-admin/js/jquery.js" type="text/javascript"></script>
</head>
<body>
<h1>
<span class="action-span"><a href="/sys-admin/action/auth/role.php?met=addui">添加角色</a></span>
<span id="search_id" class="action-span1">角色管理</span>
</h1>
<div class="list-div" id="listDiv">
<table cellpadding="3" cellspacing="1">
  <tr>
    <th class="num">#</th>
    <th>用户名</th>
    <th>排序</th>
    <th>操作</th>
  </tr>
  <{section name=role loop=$roles}> 
	  <tr class="share">
	  	<td class="num"><{$smarty.section.role.index+1}></td>  
	    <td><{$roles[role].role_name}></td>  
	    <td><{$roles[role].sort_order}></td> 
	    <td> 
		<a href="/sys-admin/action/auth/role.php?met=editui&rid=<{$roles[role].role_id}>" class="oper_edit" title="编辑"></a>
		<a href="javascript:delRole(<{$roles[role].role_id}>,'<{$roles[role].role_name}>');" class="oper_trash" title="删除"></a>
	    </td>
	</tr>
   <{/section}>
</table>
</div>
<script type="text/javascript">
function delRole(roleId,rname){
	if(confirm("您确定要删除'"+rname+"'?")){
		$.get('/sys-admin/action/auth/role.php?met=delete&rid='+roleId+'&t='+(new Date().getTime()),null,function(result){
			if($.trim(result) == "1"){
				alert("删除'"+rname+"'成功");
				document.location.reload();
			}else{
				alert("删除'"+rname+"'失败");
				document.location.reload();
			}
		});
	}
}
</script>
</body></html>